//
//  HttpRequest.h
//  TuYangTu
//
//  Created by Jpwang on 16/10/9.
//  Copyright © 2016年 Jpwang. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "Reachability.h"
#import "BaseRequest.h"

#ifdef isProduction
#define baseUrl @"https://api.xyblock.net"
#define baseUrl2 @"https://api.xyblock.net"
#else
#define baseUrl @"https://api.xyblock.net"
#define baseUrl2 @"https://api.xyblock.net"
#endif

/******************************************************************************************************
#pragma mark 最新API接口
*******************************************************************************************************/

#define URL_user_reg_sms          @"/v1/app/signup/sms"
#define URL_user_reg              @"/v1/app/signup"
#define URL_user_login            @"/v1/app/login/"
#define URL_update_pwd_sms        @"/v1/app/update_password/sms"
#define URL_update_pwd            @"/v1/app/update_password"

#define s_wallet                 [NSString stringWithFormat:@"%@/v1/wallet/",baseUrl]
#define s_device                 [NSString stringWithFormat:@"%@/v1/device/",baseUrl]

#define w_binding_sms            [NSString stringWithFormat:@"%@binding/sms",s_wallet]
#define w_binding                [NSString stringWithFormat:@"%@binding",s_wallet]
#define w_unbinding_sms          [NSString stringWithFormat:@"%@unbinding/sms",s_wallet]
#define w_unbinding              [NSString stringWithFormat:@"%@unbinding",s_wallet]
#define w_extract_sms            [NSString stringWithFormat:@"%@extract/sms",s_wallet]
#define w_extract                [NSString stringWithFormat:@"%@extract",s_wallet]
#define w_point                  [NSString stringWithFormat:@"%@point",s_wallet]
#define d_device_list            [NSString stringWithFormat:@"%@/v1/device",baseUrl]
#define d_device_binding         [NSString stringWithFormat:@"%@qrcode/binding",s_device]
#define d_detail                 s_device     //  %s/state
#define d_cmd                    s_device
#define d_label                  s_device     //  %s/label
#define w_yesterday_point_device [NSString stringWithFormat:@"%@device/",s_wallet]
#define w_yesterday_point        [NSString stringWithFormat:@"%@device/yesterday_point",s_wallet]
#define w_yesterday_detail       [NSString stringWithFormat:@"%@device/yesterday_point/detail",s_wallet]
#define d_device_list            [NSString stringWithFormat:@"%@/v1/device",baseUrl]
#define w_point_history          [NSString stringWithFormat:@"%@/point/detail",s_wallet]
#define w_point_detail           [NSString stringWithFormat:@"%@/device/point/detail",s_wallet]

#define Url_banner                   [NSString stringWithFormat:@"%@/v1/banners",baseUrl]



@interface HttpRequest : BaseRequest

+ (HttpRequest *)shareInstance;

#pragma mark API接入
- (RACSignal *)regSms:(NSDictionary *)dic;

- (RACSignal *)reg:(NSDictionary *)dic chipher:(NSData *)chipher;

- (RACSignal *)login:(NSDictionary *)dic chipher:(NSData *)chipher;

- (RACSignal *)updatePwdSms:(NSDictionary *)dic;

- (RACSignal *)updatePwd:(NSDictionary *)dic chipher:(NSData *)chipher;

- (RACSignal *)signGet:(NSString *)url map:(NSMutableDictionary *)dic;

- (RACSignal *)signPost:(NSString *)url map:(NSMutableDictionary *)dic;


@end

